package com.ztk.threadbasic.park;

import java.util.concurrent.locks.LockSupport;

public class Park01 {
    public static void main(String[] args) throws InterruptedException {

        Thread thread = new Thread(() -> {
            while(true) {
                System.out.println("开始休眠");
                LockSupport.park();
                System.out.println("结束休眠");
                break;
            }
        });

        thread.start();
        Thread.sleep(2000);
        LockSupport.unpark(thread);
    }
}
